<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ page contentType="text/html; charset=utf-8" language="java"
	import="java.sql.*" errorPage=""%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>  

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- TemplateBeginEditable name="doctitle" -->
<title>Ajouter un nouveau indicateur</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
<style type="text/css">
<!--
-->
</style>
<link href="<%=request.getContextPath()%>/css/css_style.css"
	rel="stylesheet" type="text/css">
</head>
<script type="text/javascript">

function chargerEmplacements(){
	if (document.getElementById("niveau_base").value != "aucun"){
		document.forms["formIndicateur"].action = '<%=request.getContextPath()%>/indicateurCalcules/getEmplacements.action';
		document.forms["formIndicateur"].submit();
	}
}
</script> 
<body>
	<div class="container">
		<div class="header"></div>
		<div class="upmenu">
			<div style="text-align: left; float: left; margin-left: 10px;">
				Bienvenue :
				<s:property value="#session.nom" />
				<s:property value="#session.prenom" />
			</div>
			<div style="text-align: right; float: right; margin-right: 10px;">
				<a href="<%=request.getContextPath()%>/users/logout.action">Se deconnecter</a>
			</div>
		</div>
		<div class="leftmenu">
				<ul id="menu-accordeon">
   <li><a href="<%=request.getContextPath()%>/themes/ListeThemes.action">Liste des thémes</a>
   
   </li>
		</div>
		<div class="content">
			<div class="content-header">Ajouter un indicateur calculé</div>
			<div class="content-core">
				<s:fielderror></s:fielderror>

				<form name="formIndicateur" action="<%=request.getContextPath()%>/indicateurCalcules/AjouterIndicateurCalcule.action?identifiantTheme=<%=request.getParameter("identifiantTheme")%>">
				
				
				
				<table>
					
					<tr>
						<td><label>Libelle :</label></td>
						<td><input type="text" name="libelle" value='<c:out value="${libelle}"/>' /></td><br>
					</tr>
					
					<tr>
						<td><label>Type :</label></td>
						<td><select id="type" name="type" value='<c:out value="${type}"/>'">
									<option value="aucun">Choisissir le type</option>
									<c:if test="${type == 'true'}">
										<option value="true" selected>Calculable</option>
									</c:if>
									<c:if test="${type == 'false'}">
										<option value="false" selected>NonCalculable</option>
									</c:if>
									
									<c:if test="${type != 'true'}">
										<option value="true">Calculable</option>
									</c:if>
									<c:if test="${type != 'false'}">
										<option value="false">NonCalculable</option>
									</c:if>
									
								</select>
							</td>
							<br>					</tr>
<!-- 					<tr> -->
<!-- 						<td><label>Année:</label></td> -->
<%-- 					<td><input type="int" name="annee" value='<c:out value="${annee}"/>'/></td><br> --%>
						
<!-- 					</tr> -->
					
<!-- 					<tr> -->
<!-- 						<td><label>Valeur :</label></td> -->
<%-- 						<td><input type="text" name="valeur" value='<c:out value="${valeur}"/>'/></td><br> --%>
<!-- 					</tr> -->
<!-- 						<tr> -->
<!-- 							<td><label>Niveau de base:</label></td> -->
<%-- 							<td><select id="niveau_base" name="niveau_base" value='<c:out value="${niveau_base}"/>' onchange="chargerEmplacements();"> --%>
<!-- 									<option value="aucun">Choisissez l'emplacement</option> -->
<%-- 									<c:if test="${niveau_base == 'region'}"> --%>
<!-- 										<option value="region" selected>Region</option> -->
<%-- 									</c:if> --%>
<%-- 									<c:if test="${niveau_base == 'province'}"> --%>
<!-- 										<option value="province" selected>Province</option> -->
<%-- 									</c:if> --%>
<%-- 									<c:if test="${niveau_base == 'commune'}"> --%>
<!-- 										<option value="commune" selected>Commune</option> -->
<%-- 									</c:if> --%>
<%-- 									<c:if test="${niveau_base == 'poi'}"> --%>
<!-- 										<option value="poi" selected>Poi</option> -->
<%-- 									</c:if> --%>
<%-- 									<c:if test="${niveau_base != 'region'}"> --%>
<!-- 										<option value="region">Region</option> -->
<%-- 									</c:if> --%>
<%-- 									<c:if test="${niveau_base != 'province'}"> --%>
<!-- 										<option value="province">Province</option> -->
<%-- 									</c:if> --%>
<%-- 									<c:if test="${niveau_base != 'commune'}"> --%>
<!-- 										<option value="commune">Commune</option> -->
<%-- 									</c:if> --%>
<%-- 									<c:if test="${niveau_base != 'poi'}"> --%>
<!-- 										<option value="poi">Poi</option> -->
<%-- 									</c:if> --%>
<%-- 								</select> --%>
<!-- 							</td> -->
<!-- 							<br> -->
<!-- 						</tr> -->
<!-- 						<tr> -->
<!-- 						<td><label>Emplacement :</label></td> -->
<!-- 						<td> -->
<%-- 						<c:if test="${not empty listeEmplacments}"> --%>
<%-- 						<s:select  id="emplacement"  name="nom"  headerKey="aucun" --%>
<%-- 									headerValue="Choisissez l'emplacement" list="listeEmplacments" --%>
<%-- 									/> --%>
<%-- 						</c:if> --%>

<!-- 							</td> <br> -->
						
<!-- 					</tr> -->
					
					<tr>
						<td><s:submit value="Valider"></s:submit></td>
						<td></td>
					</tr>
					
				</table>
						<s:textfield cssStyle="display:none;" name="identifiantTheme" value="%{#parameters['identifiantTheme']}"></s:textfield>
				
				</form>
				<s:if test="hasActionErrors()">
						<s:actionerror />
				</s:if>
			</div>
		</div>
	</div>
</body>
</html>